#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
#define int long long
int dp[200005];
signed main(){
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	int x,y;
	cin>>x>>y;
	dp[x]=1;
	for(int i=x+1;i<=y;i++){
		dp[i]=dp[i-1];
		if(i%2==0)dp[i]=(dp[i]+dp[i/2])%mod;
	}
	// for(int i=0;i<=10;i++)cout<<dp[1<<i]<<" ";
	cout<<dp[y]<<'\n';
	return 0;
}
/*
S(k)=
S_0(k)
f(k)=S(k-1)+S_0(k-1)
*/